﻿namespace EasyLib.Patterns.Specification
{
    /// <summary>
    /// <code>
    /// public class OddSpecification : CompositeSpecification<int>
    ///{
    ///    public override bool IsSatisfiedBy(int candidate)
    ///    {
    ///        return candidate % 2 != 0;
    ///    }
    ///}
    /// </code>
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface ISpecification<T>
    {
        bool IsSatisfiedBy(T candidate);

        ISpecification<T> And(ISpecification<T> other);

        ISpecification<T> Or(ISpecification<T> other);

        ISpecification<T> Not();
    }
}
